#include "glibinterface.h"
#include <QString>
#include <gio/gio.h>

#define STYLE_TYPE_SCHEMA        "org.ukui.style"
#define KEY_SYSTEM_FONT_SIZE     "system-font-size"
#define DEFAULT_FONT_SIZE	 (10.0)

double getDefaultFontSize()
{
    GSettingsSchemaSource *schema_source = NULL;
    GSettingsSchema  *schema = NULL;

    schema_source = g_settings_schema_source_get_default();
    if(schema_source){
        schema = g_settings_schema_source_lookup (schema_source,KEY_SYSTEM_FONT_SIZE,TRUE);
	if(schema){
	    GVariant *size;
            unsigned long length;
            GSettings *gs;

            gs = g_settings_new(STYLE_TYPE_SCHEMA);
            size = g_settings_get_default_value(gs, KEY_SYSTEM_FONT_SIZE);
            QString fontsize(g_variant_get_string(size,&length));
            g_object_unref(gs);

	    return fontsize.toDouble();
	}
    }
    return DEFAULT_FONT_SIZE;
}
